import React, { Component } from 'react'
//路由传参
import {withRouter} from "react-router-dom"
import {Bottom} from "antd-mobile"
import "./index.scss"
import HomeStart from '../../assets/img/homestart.jpg'
class Index extends Component {
    
    handleClick = (params) => {
        this.props.history.push("/searchCenter");
    }

    componentDidMount(){
        const userAccount = localStorage.getItem("userAccount")
        const userAccountNew = JSON.parse(userAccount) || {}

        setTimeout(()=>{
            if(userAccountNew){
                if(userAccountNew.emailValue){
                    this.props.history.push("/login")
                }else{
                    this.props.history.push("/register")
                }
            }
        },2000)
    }
    
    render() {
        return <div
            style={{fontSize:20,transition:'all'}}
            >
            <img 
                style={{width:"100%",height:"100%",marginTop:0}}
                src={HomeStart}/>
            </div>
    }
}
export default withRouter(Index)
